<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Edit expense</title>
        <link rel="icon" type="image/png" href="{{ url_for('static', filename='phillfinance.png') }}">
        <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
    </head>
    <body>
        <div class="container">
<h2>Edit Expense</h2>

<!-- Edit Expense Form -->
<form method="POST" class="form-container">
    {{ form.hidden_tag() }}
    
    <!-- Amount Field -->
    <div class="form-group cool-date-field">
        {{ form.amount.label(class="form-label") }}
        {{ form.amount(class="form-control", placeholder="Enter updated amount") }}
        {% for error in form.amount.errors %}
            <span class="text-danger">{{ error }}</span>
        {% endfor %}
    </div>
    
    <!-- Category Field -->
    <div class="form-group cool-date-field">
        {{ form.category.label(class="form-label") }}
        {{ form.category(class="form-control", placeholder="Select updated category") }}
        {% for error in form.category.errors %}
            <span class="text-danger">{{ error }}</span>
        {% endfor %}
    </div>
    
    <!-- Description Field -->
    <div class="form-group cool-date-field">
        {{ form.description.label(class="form-label") }}
        {{ form.description(class="form-control", placeholder="Update description (optional)") }}
        {% for error in form.description.errors %}
            <span class="text-danger">{{ error }}</span>
        {% endfor %}
    </div>
    
    <!-- Date Field -->
<div class="form-group cool-date-field">
    {{ form.date.label(class="form-label") }}
    {{ form.date(class="form-control stylish-input", placeholder="Select a date") }}
    {% for error in form.date.errors %}
        <span class="text-danger">{{ error }}</span>
    {% endfor %}
</div>


    <!-- Action Buttons -->
    <div class="form-actions">
        <button type="submit" class="btn btn-primary">Save Changes</button>
        <button type="button" class="cancel" onclick="window.location='{{ url_for('dashboard') }}'">Cancel</button>
    </div>
</form>
</div>
</body>
</html>

